package chapter7;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

/**
 * 使用Scanner读取文件中的内容
 */
public class ScannerFileTest {
    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(new File("src/chapter7/ScannerFileTest.java"));
        while (scanner.hasNextLine()) {
            System.out.println(scanner.nextLine());
        }
    }
}
